#/*
# * Revision Control Information
# *
# * $Source: /vol/opua/opua2/sis/sis-1.1/common/src/sis/sparse/RCS/Makefile,v $
# * $Author: sis $
# * $Revision: 1.2 $
# * $Date: 1992/05/06 19:01:57 $
# *
# */
# sparse -- sparse matrix package
#---------------------------------------------------------------------------

CAD	= /projects/octtools/octtools/$(MACHINE)
SIS	= ..
LINTCREATEFLAG = -C

CC 	= gcc

P	= sparse
PSRC	= rows.c cols.c matrix.c
POBJ	= $(PSRC:.c=.o)
PHDR	= sparse.h sparse_int.h
MISC	= $(P).doc Makefile

TARGET	= libsparse.a

LIBS	= 


INCLUDE	= -I/home/i/mcv/include

CFLAGS	= -g $(INCLUDE) -DUNIX
LDFLAGS	= -g

#----------------------------------------------------------------------
foo: install

.c.o:
	$(CC) $(CFLAGS) -c -DFAST_AND_LOOSE $*.c

cols.o: cols.c
	$(CC) $(CFLAGS) -c -DFAST_AND_LOOSE -DCOLS cols.c

sparse.dvi: sparse.tex
	-latex sparse

#----------------------------------------------------------------------

$(TARGET): $(PHDR) $(POBJ) $(LIBS)

install: lib$(P).a

lib$(P).a: $(POBJ)
	@rm -f lib$(P).a
	ar cr lib$(P).a $(POBJ)
	ranlib lib$(P).a

unpack: lib$(P).a
	@for i in $(POBJ); do				
	    ln -s $(SIS)/$(P)/$$i $(SIS)/unpack;	\
	done

llib-l$(P).ln: $(PSRC) $(PHDR)
	lint $(LINTFLAGS) ${LINTCREATEFLAG}$(P) -n $(PSRC)

clean:
	rm -f $(TARGET) *.so *.ln *.o \
	    [Tt]ags [Mm]ake.out malloc.out gmon.out lint

tags: _force
	@for i in $(PSRC) $(PHDR); do			\
	    cwd=`pwd`; ctags -a $$cwd/$$i;		\
	done;

strip_depend:
	sed '/^#--DO NOT CHANGE ANYTHING AFTER THIS LINE/,$$d' Makefile >mktemp
	mv mktemp Makefile

depend:
	sed '/^#--DO NOT CHANGE ANYTHING AFTER THIS LINE/,$$d' Makefile >mktemp
	echo '#--DO NOT CHANGE ANYTHING AFTER THIS LINE' >>mktemp
	$(CAD)/bin/cc-M $(CFLAGS) $(PSRC) | \
	    sed 's|$(CAD)|$$(CAD)|g' | \
	    grep -v '/usr/include' >>mktemp
	mv mktemp Makefile

#-------------------------- IBM 3090 support -----------------
IBMHOST	= opua
IBMDIST	= /users2/sis
ibmdist: $(PSRC) $(PHDR)
	rdist -Richw $(PSRC) $(PHDR) $(IBMHOST):$(IBMDIST)
#-------------------------------------------------------------
_force:

